package edu.ccut.saturn.workflow.startWorkFlowModule.code;

import edu.ccut.saturn.workflow.common.Constants;

public class WorkFlowInstanceFactory {
	/**
	 * 返回activityType所指定的激活活动类
	 * @param activityType
	 * @return
	 */
	public static IActivateActivity getActivateActivity(String activityType) {
		if (activityType.equals(Constants.ACTIVITY_TYPE_MAN)) {
			return  new ActivateManualActivity() ;
		} else if (activityType.equals(Constants.ACTIVITY_TYPE_DECISION)) {
			return  new ActivateDecisionActivity() ;
		} else if (activityType.equals(Constants.ACTIVITY_TYPE_AUTO)) {
			return  new ActivateAutoActivity() ;
		}else if (activityType.equals(Constants.ACTIVITY_TYPE_END)) {
			return  new ActivateEndActivity() ;
		}else if (activityType.equals(Constants.ACTIVITY_TYPE_SUB)) {
			return  new ActivateSubActivity() ;
		}else{
			return null;
		}
	}
	/**
	 * 返回参与者获得器
	 * @param getType
	 * @return
	 */
	public static IParticipantGeter getParticipantGeter(String getType) {
		if(getType.equals(Constants.OBTAINFROMACTIVITYRADIOBUTTON_COMMON)){
			return new GetParticipantFromTree();
		}else if(getType.equals(Constants.OBTAINFROMACTIVITYRADIOBUTTON_ACTIVITY)){
			return new GetParticipantFromActivity();
		}else if(getType.equals(Constants.OBTAINFROMACTIVITYRADIOBUTTON_CUSTOM)){
			return new GetParticipantFromLogic();
		}else if(getType.equals(Constants.OBTAINFROMACTIVITYRADIOBUTTON_START)){
            return new GetParticipantFromCreator();			
		}else if(getType.equals(Constants.OBTAINFROMACTIVITYRADIOBUTTON_CHANGE)){
			 return new GetParticipantFromChange();	
		}else {
			return null;
		}
		
	}
}
